#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include"hw.h"

int main(int argc, char *argv[]){
	if(argc < 4)
		return -1;
	int (*p)(int, int);
	int num1;
	int num2;
	int res;

	if(strcmp(argv[2], "+") == 0){
		p = add;
	}else if(strcmp(argv[2], "-") == 0){
		p = sub;
	}else if(strcmp(argv[2], "x") == 0){
		p = mul;
	}else if(strcmp(argv[2], "/") == 0){
		p = dive;
	}else{
		printf("哎呦，你干嘛\n");
		return 1;
	}
	num1 = atoi(argv[1]);
	num2 = atoi(argv[3]);

	res = op(num1, num2, p);
	printf("%d %s %d = %d\n", num1, argv[2], num2, res);

	return 0;
}
